import request from "@/config/utils/request";
/**
 * 结算单维护api
 * */
//结算列表
export function getSettlementList(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/listPage",
        method: "post",
        data
    });
}

// 删除
export function remove(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/remove",
        method: "post",
        data
    });
}

// 撤回
export function revoke(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/revoke",
        method: "post",
        data
    });
}

// 选择合同
export function getEquipmnetInfoForSettlement(data) {
    return request({
        url: "/apis/smp/smpequipment/getEquipmnetInfoForSettlement",
        method: "post",
        data
    });
}
// 基本信息 - 合同编号
export function listSmpEquipmentForScPage(data) {
    return request({
        url: "/apis/smp/smpequipment/listSmpEquipmentForScPage",
        method: "post",
        data
    });
}

// 验收单
export function listAcceptanceCert(data) {
    return request({
        url: "/apis/smp/acceptancecert/listAcceptanceCert",
        method: "post",
        data
    });
}

//查询验收单详情
export function getAcceptanceCert(data) {
    return request({
        url: "/apis/smp/acceptancecert/getAcceptanceBill",
        method: "post",
        data
    });
}

//保存结算单
export function saveSettlement(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/save",
        method: "post",
        data
    });
}

// 编辑保存
export function editSettlement(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/edit",
        method: "post",
        data
    });
}

//提交结算单
export function submitSettlement(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/submit",
        method: "post",
        data
    });
}

// 暂存结算单
export function tsSettlement(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/tempSave",
        method: "post",
        data
    });
}

// 编辑暂存
export function tempEdit(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/tempEdit",
        method: "post",
        data
    });
}

// 详情
export function getById(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/getById",
        method: "post",
        data
    });
}

// 退回供应商
export function sendBackToSupplier(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/sendBackToSupplier",
        method: "post",
        data
    });
}

/**
 * 结算单冲销api
 * */

// 列表
export function listSettlementWritePage(data) {
    return request({
        url: "/apis/smp/equipmentSettlementwrite/listSettlementWritePage",
        method: "post",
        data
    });
}

// 撤回
export function revokeSettlementWrite(data) {
    return request({
        url: "/apis/smp/equipmentSettlementwrite/revokeSettlementWrite",
        method: "post",
        data
    });
}

// 删除
export function removeSettlementWrite(data) {
    return request({
        url: "/apis/smp/equipmentSettlementwrite/removeSettlementWrite",
        method: "post",
        data
    });
}

// 基本信息 - 结算单编号
export function newWriteSettlementListPage(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/newWriteSettlementListPage",
        method: "post",
        data
    });
}

// 结算单数据
export function getSettlementById(data) {
    return request({
        url: "/apis/smp/equipmentsettlement/getById",
        method: "post",
        data
    });
}

// 保存 / 提交
export function saveSettlementWrite(data) {
    return request({
        url: "/apis/smp/equipmentSettlementwrite/saveSettlementWrite ",
        method: "post",
        data
    });
}

// 修改
export function editSettlementWrite(data) {
    return request({
        url: "/apis/smp/equipmentSettlementwrite/editSettlementWrite",
        method: "post",
        data
    });
}

// 详情
export function getSettlementWriteById(data) {
    return request({
        url: "/apis/smp/equipmentSettlementwrite/getSettlementWriteById",
        method: "post",
        data
    });
}

/**
 * 结算审批
 * */
// list
export function getSettlementApproval(data, typeUrl) {
    return request({
        url: `/apis/smp/approval/list/settlement/equipment/${typeUrl}`,
        method: "post",
        data
    });
}
